package com.tengju.bff.interfaces.data.assembler;

import com.tengju.bff.interfaces.data.vo.AchievementBonusMidDetailVO;
import com.tengju.data.domain.model.report.AchievementBonus;
import com.tengju.data.domain.model.report.AchievementBonusCalMidInfo;
import com.tengju.data.domain.model.report.AchievementBonusResult;

/**
 * @author chenhang
 * @Date 2020/12/25
 */
public class AchievementBonusAssembler {
    public static AchievementBonusMidDetailVO bonusToDetail(AchievementBonus achievementBonus) {
        AchievementBonusMidDetailVO detailVO = new AchievementBonusMidDetailVO();
        detailVO.setIdCode(achievementBonus.getIdCode().getValue());
        detailVO.setSmallTeamCancelBeforeAchievement(achievementBonus.getSmallTeamCancelBeforeAchievement());
        detailVO.setAllTeamCancelBeforeAchievement(achievementBonus.getAllTeamCancelBeforeAchievement());
        detailVO.setTheoryAchievement(achievementBonus.getTheoryAchievement());
        detailVO.setAchievement(achievementBonus.getAchievement());
        detailVO.setSettleAchievement(achievementBonus.getSettleAchievement());
        detailVO.setUserTag(achievementBonus.getUserTag());
        detailVO.setTeamRatioType(achievementBonus.getTeamRatioType());
        return detailVO;
    }

    public static AchievementBonusMidDetailVO bonusAndMidToDetail(AchievementBonus achievementBonus, AchievementBonusCalMidInfo achievementBonusCalMidInfo, int childrenNum) {
        AchievementBonusMidDetailVO detailVO = new AchievementBonusMidDetailVO();
        detailVO.setIdCode(achievementBonus.getIdCode().getValue());
        detailVO.setSmallTeamCancelBeforeAchievement(achievementBonus.getSmallTeamCancelBeforeAchievement());
        detailVO.setAllTeamCancelBeforeAchievement(achievementBonus.getAllTeamCancelBeforeAchievement());
        detailVO.setTheoryAchievement(achievementBonus.getTheoryAchievement());
        detailVO.setAchievement(achievementBonus.getAchievement());
        detailVO.setSettleAchievement(achievementBonus.getSettleAchievement());
        detailVO.setUserTag(achievementBonus.getUserTag());
        detailVO.setTeamRatioType(achievementBonus.getTeamRatioType());
        detailVO.setChildrenNum(childrenNum);
        detailVO.setProfit(achievementBonus.getProfit());
        if (achievementBonusCalMidInfo != null) {
            detailVO.setSmallTeamAchievement(achievementBonusCalMidInfo.getSmallTeamMoneyOut());
        }
        return detailVO;
    }
}
